package org.dtrd.modules.archive.entity.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveReverseScheme;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
 * 逆转方案
 * </p>
 *
 * @author QR
 * @since 2022-01-10
 */
@Data
@ApiModel(value = "逆转方案详情")
public class ReverseSchemeDetail {

    private Integer dataId;

    @NotNull
    @Min(value = 1)
    @ApiModelProperty("患者id")
    private Integer patientId;

    @NotNull
    @Min(value = 1)
    @ApiModelProperty("服务模版id")
    private Integer serviceTemplateId;

    @NotNull
    @Min(value = 1)
    @ApiModelProperty("打卡模版id")
    private Integer signinTemplateId;

    @ApiModelProperty("知情同意书")
    private String consentImage;

    @ApiModelProperty("服务协议")
    private String protocolImage;

    @ApiModelProperty("生活方式评估方案")
    private String lifePlan;

    @ApiModelProperty("用药方案")
    private String drugPlan;

    @ApiModelProperty("饮食方案")
    private String dietPlan;

    @ApiModelProperty("运动方案")
    private String sportPlan;

    @NotNull
    @ApiModelProperty("服务开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date serviceStartTime;

    @ApiModelProperty("饮食原则, 1-低碳, 2-低盐")
    private String principleDiet;

    @ApiModelProperty("蛋白质摄入原则, 1-1-1.0g/日, 2-针对贫血改善")
    private String principleProtein;

    @ApiModelProperty("运动原则, 1-循序渐进, 2-有氧, 3-有氧+增肌, 4-运动强度酌情限制")
    private String principleSport;

    @ApiModelProperty("其他")
    private String other;


    public ReverseSchemeDetail parseFromPo(DtrdEntRdArchiveReverseScheme po) {
        dataId = po.getDataId();
        patientId = po.getPatientId();
        serviceTemplateId = po.getServiceTemplateId();
        signinTemplateId = po.getSigninTemplateId();
        consentImage = po.getConsentImage();
        protocolImage = po.getProtocolImage();
        lifePlan = po.getLifePlan();
        drugPlan = po.getDrugPlan();
        dietPlan = po.getDietPlan();
        sportPlan = po.getSportPlan();
        serviceStartTime = po.getServiceStartTime();
        principleDiet = po.getPrincipleDiet();
        principleProtein = po.getPrincipleProtein();
        principleSport = po.getPrincipleSport();
        other = po.getOther();
        return this;
    }
}
